package org.learn.intermediate.homework;

public class HomeWork07 {
    public static void main(String[] args) {
        Car car = new Car(45);
        car.getAir().flow(car.getTemperature());
        Car car1 = new Car(-3);
        car1.getAir().flow(car1.getTemperature());

    }
}
class Car {
    private double temperature;
    class Air {
        public  void  flow(double temperature){
            if(temperature < 0){
                System.out.println("温度低于0，吹暖气");
            }else if(temperature > 40 ){
                System.out.println("温度高于40,吹冷风");
            }
        }
    }
   public Air getAir(){
        return new Air();
   }
    public Car(double temperature) {
        this.temperature = temperature;
    }

    public double getTemperature() {
        return temperature;
    }

    public void setTemperature(double temperature) {
        this.temperature = temperature;
    }
}